tools/libxc/xc_dom_arm: add missing variable initialization
authorBernd Kuhls <bernd.kuhls@t-online.de>
Sat, 19 Aug 2017 14:21:42 +0000 (16:21 +0200)
committerWei Liu <wei.liu2@citrix.com>
Tue, 22 Aug 2017 15:36:20 +0000 (16:36 +0100)
commit88bfbf90e35f1213f9967a97dee0b2039f9998a4
tree7e19121b7572e5f1bed95f2aa3bee3ae98f966c6
parent0c5f2f9cefacd0881b86abbe36e231815cef7735
tools/libxc/xc_dom_arm: add missing variable initialization

The variable domctl.u.address_size.size may remain uninitialized if
guest_type is not one of xen-3.0-aarch64 or xen-3.0-armv7l. And the
code precisely checks if this variable is still 0 to decide if the
guest type is supported or not.

This fixes the following build failure with gcc 7.x:

xc_dom_arm.c:229:31: error: 'domctl.u.address_size.size' may be used uninitialized in this function [-Werror=maybe-uninitialized]
     if ( domctl.u.address_size.size == 0 )

Patch originally taken from
https://www.mail-archive.com/xen-devel@lists.xen.org/msg109313.html.

Signed-off-by: Bernd Kuhls <bernd.kuhls@t-online.de>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@free-electrons.com>
Acked-by: Wei Liu <wei.liu2@citrix.com>
tools/libxc/xc_dom_arm.c